<%-- 
    Document   : Search
    Created on : Feb 14, 2012, 4:39:21 PM
    Author     : Alex
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="bean.ExamMark"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>

        <table border="0" width="300" align="center" bgcolor="#CDFFFF">
            <tr>
                <td colspan=2 style="font-size:12pt;color: black;" align="center"><h3>Search</h3></td>
            </tr>
            <form action="SearchID" method="post">
                <tr>
                    <td><b>Student ID:</b></td>
                    <td>: <input  type="text" name="txtSt">
                    </td>
                </tr>
                <tr>
                    <td colspan=2 align="center"><input  type="submit" name="submit" value="Search"></td>
                </tr>
            </form>
        </table>

        <table border="0" cellpadding="4">
            <tr>
                <td><b>Student ID</b></td>
                <td><b>Student Name</b></td>
                <td><b>Mark</b></td>
                <td><b>Status</b></td>
            </tr>
            <%
                        try {
                            ArrayList<ExamMark> result = (ArrayList<ExamMark>) request.getSession().getAttribute("abc");
                            for (ExamMark e : result) {
            %>
            <tr>
                <td><%=e.getStuId()%></td>
                <td><%=e.getStuName()%></td>
                <td><%=e.getMaMark()%></td>
                <td><%
                     Float a=e.getMaMark();
                     if(a<10)
                     {%>
                        Fail
                     <%}
                     else
                     {%>
                        Pass
                     <%}
                        %></td>
            </tr>
            <%                                 }
                        } catch (Exception excep) {
                        }
            %>
        </table>
    <!--<c:if test="${not empty requestScope.abc}">
        <table border="0" cellpadding="4">
            <tr>
                <td><b>Student ID</b></td>
                <td><b>Student Name</b></td>
            </tr>
            <c:forEach items="${requestScope.abc}" var="s">
                <tr>
                    <td>${s.stuId}</td>
                    <td>${s.stuName}</td>
                </tr>
            </c:forEach>
        </table>
    </c:if>
        -->
    </body>
</html>
